﻿using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace ConsoleTest.Services
{
    /// <summary>
    /// Hello World服务
    /// </summary>
    /// <param name="logger"></param>
    public class HelloWorldService(ILogger<HelloWorldService> logger) : IHostedService
    {
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            logger.LogInformation("Hello World");
            await Task.CompletedTask;
        }
        public async Task StopAsync(CancellationToken cancellationToken) => await Task.CompletedTask;
    }
}
